package com.zsc.projectmanagementapi.controller;

import com.zsc.projectmanagementapi.commons.ServerResponse;
import com.zsc.projectmanagementapi.pojo.Dao.CreateProjectDao;
import com.zsc.projectmanagementapi.pojo.Do.Project;
import com.zsc.projectmanagementapi.service.ProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author LinHj
 * @date 2021/6/30 16:15
 **/
@RestController
@RequestMapping("/project")
public class ProjectPlanController {

    @Autowired
    ProjectService projectService;

    @PostMapping("/addProject")
    public ServerResponse addProject(@RequestBody CreateProjectDao createProjectDao){
        int i = projectService.insertProjectAndPlan(createProjectDao);
        return ServerResponse.createBySuccess(i);
    }
}
